var pageii = null;
var grid = null;
$(function() {
	grid = lyGrid({
		pagId : 'paging',
		l_column : [{
			colkey : "create_time",
			name : "日期"
		}, {
			colkey : "machine_no",
			name : "机台号"
		}, {
			colkey : "mold_encode",
			name : "模具编号"
		}, {
			colkey : "cname",
			name : "客户"
		}, {
			colkey : "oname",
			name : "产品名称"
		}, {
			colkey : "client_weight",
			name : "定重"
		}, {
			colkey : "client_weight",
			name : "定重一半",
			renderData : function(rowindex,data, rowdata, column) {
				return data/2;
			}
		}, {
			colkey : "cavityCountSet",
			name : "每模套数"
		}, {
			colkey : "cavityCountPiece",
			name : "每套件数"
		}, {
			colkey : "",
			name : "实际每模套数"
		}, {
			colkey : "",
			name : "实际每套件数"
		}, {
			colkey : "order_number",
			name : "生产计划数"
		}, {
			colkey : "",
			name : "甲班生产数"
		}, {
			colkey : "",
			name : "乙班生产数"
		}, {
			colkey : "",
			name : "昨天生产数"
		}, {
			colkey : "",
			name : "累计数"
		}, {
			colkey : "",
			name : "剩余产量"
		}, {
			colkey : "",
			name : "标准产能"
		}, {
			colkey : "",
			name : "累计数"
		}, {
			colkey : "premake",
			name : "备注"
		} ],
		jsonUrl : rootPath
				+ '/enterstorage_order_form/enterstorage_order_findByPage.shtml',
		dymCol : true,
		checkbox : true,
		serNumber : false
	});
	$("#editFun").click("click", function() {
		editAccount();
	});
	$("#search").click("click", function() {//  绑定查询按扭
		var searchParams = $("#searchForm").serializeJson();
		grid.setOptions({
			data : searchParams
		});
	});

});
function editAccount() {
	var cbox = grid.getSelectedCheckbox();
	if (cbox.length > 1 || cbox == "") {
		 layer.msg("只能选中一个");
		 return;
	}
	pageii = layer.open({
		title : "编辑入库报表",
		type : 2,
		area : [ "800px", "100%" ],
		content : rootPath
				+ '/enterstorage_order_form/enterstorage_order_form_edit.shtml?id=' + cbox
	});
}







